package org.csu.mypetstore.persistence;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

public interface ManageCategoryMapper {
    @Insert("        SET foreign_key_checks = 0;\n" +
            "        insert into Category(catid,name,descn)\n" +
            "        values(#{categoryId},#{name},#{description});\n" +
            "        SET foreign_key_checks = 1;")
    public void insertCategory(String categoryId,String name,String description);

    @Update("update Category set name = #{name},descn = #{description} where catid = #{categoryId}")
    public void updateCategory(String categoryId,String name,String description);

    @Delete("        SET foreign_key_checks = 0;\n" +
            "        delete from Category  where catid = #{categoryId};\n" +
            "        SET foreign_key_checks = 1;")
    public void deleteCategory(String categoryId);


}